<?php 
header('Cache-Control: no-cache, must-revalidate');
header("Content-type: application/json; charset=utf-8");

session_start();

require_once '../core/admin.php';

$_SESSION['is_login'] = 0;

$s = $_REQUEST['secret'];
$u = $_REQUEST['u'];
$p = $_REQUEST['p'];

$result = 0;

if(doAuthenticate($u, $p, $s)){
    $result = 1;
    $_SESSION['is_login'] = 1;
} else {
    $result = 0;
}
?>
{
	"result" : "<?=$result?>"
}
